package com.lun.swordtowardoffer2.c02;

public class TwoSum {
	
	public int[] twoSum(int[] array, int target) {
		
		int i = 0, j = array.length - 1;
		
		while(i < j && array[i] + array[j] != target) {
			
			if(array[i] + array[j] < target) {
				i++;
			}else {
				j--;
			}
		}
		
		return new int[] {i, j};
	}
	
}
